package com.big.app.controller;

import com.big.app.serve.WebSocketServer;
import com.big.app.vo.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/chat/") //映射地址
@CrossOrigin //跨域
@Api(value = "实现聊天相关操作",tags = "实现聊天相关操作")
public class ChatServerController {
    @GetMapping("sendmsg.do")
    public R sendMsg(String msg){
        WebSocketServer.sendMoreMsg(WebSocketServer.createMsg(msg));
        return new R(200,null);
    }
}
